package br.cin.ufpe.feedbacktest.core;

public class Timer {
	
	private long timeLimit;
	private long initialTime;
	
	public Timer(long timeLimit) {
		this.timeLimit = timeLimit;
		this.initialTime = -1L;
	}
	
	public void initTimer() {
		this.initialTime = System.currentTimeMillis();
	}
	
	public boolean timeLimitReached() {
		boolean reached = false;
		
		if (this.initialTime != -1L) {
			reached = (System.currentTimeMillis() - this.initialTime) > (this.timeLimit);
		}
		
		return reached;
	}

}
